//
//  KTEleInputRETableCell.m
//  OMENGO
//
//  Created by 梁尚嘉 on 2017/1/12.
//  Copyright © 2017年 Kamfat. All rights reserved.
//

#import "KTEleInputRETableCell.h"

@implementation KTEleInputRETableCell

- (void)configure
{
    [super configure];
    [self.inputTF mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(SM_SIZE(200)));
//        make.right.equalTo(@(SM_SIZE(-30)));
        make.top.bottom.equalTo(@(0));
    }];

    [self.contentView addSubview:self.button];
    [self.button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.inputTF.mas_right).offset(SM_SIZE(30));
        make.right.equalTo(@(SM_SIZE(-30)));
        make.width.equalTo(@(SM_SIZE(160)));
        make.top.equalTo(@(SM_SIZE(20)));
        make.bottom.equalTo(@(SM_SIZE(-20)));
    }];
}


- (UIButton *)button
{
    if (!_button) {
        _button  = [UIButton new];
        [_button setBackgroundImage:[UIImage imageWithColor:SM_thumeColor] forState:UIControlStateNormal];
        [_button setBackgroundImage:[UIImage imageWithColor:HEXCOLOR(@"#C51062")] forState:UIControlStateHighlighted];
        [_button setBackgroundImage:[UIImage imageWithColor:SM_lightGrayColor] forState:UIControlStateDisabled];
        [_button setTitleColor:SM_whiteColor forState:UIControlStateNormal];
        [_button.titleLabel setFont:kElementTableCellFont];
        [_button.layer setCornerRadius:SM_SIZE(10)];
        [_button setClipsToBounds:YES];
    }
    return _button;
}

@end
